<template>
  <div class="goods">
    <page-search :searchFormConfig="searchFormConfig" @resetBtnClick="handleResetClick" @queryBtnClick="handleQueryClick"></page-search>
    <page-content ref="pageContentRef" :contentConfig="contentConfig" :pageName="'goods'" vuexModuleName="product">
      <template #image="scope">
        <el-image style="width: 60px; height: 60px" :src="scope.row.img_url" :preview-src-list="[scope.row.img_url]"></el-image>
      </template>
      <template #oldPrice="scope">{{ '￥' + scope.row.old_price }}</template>
    </page-content>
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue'
import { PageContent } from '@/components/page-content'
import { PageSearch } from '@/components/page-search'
import { contentConfig, searchFormConfig } from './config'
import { usePageSearch } from '@/hooks/use-page-search'
import { ElImage } from 'element-plus'

export default defineComponent({
  name: 'goods',
  components: { PageContent, PageSearch, ElImage },
  setup() {
    const [pageContentRef, handleResetClick, handleQueryClick] = usePageSearch()
    return { contentConfig, searchFormConfig, pageContentRef, handleResetClick, handleQueryClick }
  }
})
</script>
<style scoped></style>
